package com.user.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.lang.Dict;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.common.R;
import com.common.ResultCode;
import com.common.SysSession;
import com.common.Util.StringUtils;
import com.user.annotation.AccessLimit;
import com.user.controller.vo.loginVo;
import com.user.controller.vo.userVo;
import com.user.entity.SysUser;
import com.user.service.IUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
* @Description:
* @Param:
* @return:
* @Author: 刘童
* @Date: 2024/6/20
*/
@RestController
@RequestMapping("/user")
public class userController {

    @Autowired
    private IUser Iuser;


    @SaCheckPermission("role:ESP")
    @GetMapping("/improve")
//    提高用户权限
    public R<Object> getProductInfo(@RequestParam("user_id") long user_id, @RequestParam("role_id") long role_id) {


        return Iuser.improvePermission(user_id, role_id) ? R.data(true) : R.fail("修改权限失败");
    }



}
